// 代理沙箱
class ProxySandBox{
  proxyWindow;
  isRunning = false;
  active(){
      this.isRunning = true;
  }
  inactive(){
      this.isRunning = false;
  }
  constructor(){
      const fakeWindow = Object.create(null);
      this.proxyWindow = new Proxy(fakeWindow,{
          set:(target, prop, value, receiver)=>{
              if(this.isRunning){
                  target[prop] = value;
              }
          },
          get:(target, prop, receiver)=>{
              return  prop in target ? target[prop] : window[prop];
          }
      });
  }
}
